// 菜单管理
import request from '@/utils/request'

// 1、获取菜单  GET /admin/acl/permission
export const reqGetPermissionList = () => {
  return request.get(`/admin/acl/permission`)
}

// 2、新增或者修改菜单 POST /admin/acl/permission/save     PUT /admin/acl/permission/update
export const reqSaveOrUpdatePermissionApi = (permission) => {
  if (permission.id) {
    // 有id 修改
    return request.put(`/admin/acl/permission/update`, permission)
  } else {
    // 没id 新增
    return request.post(`/admin/acl/permission/save`, permission)
  }
}

// 3、删除菜单  DELETE /admin/acl/permission/remove/{id}
export const reqDelPermission = (id) => {
  return request.delete(`/admin/acl/permission/remove/${id}`)
}
